package com.yyyit.bg2.pub;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class Login {

	public static String login(WebDriver driver,String baseUrl,String userName,String userPassword) {
		driver.get(baseUrl + "hkbg/#/login");
		driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);		
		driver.findElement(By.name("name")).clear();
		driver.findElement(By.name("name")).sendKeys(userName);
		driver.findElement(By.name("pwd")).clear();
		driver.findElement(By.name("pwd")).sendKeys(userPassword);
		driver.findElement(By.xpath("//button[@type='submit']")).click();
		return "登录成功";
	}
	
}
